#include <stdio.h>
#include <stdlib.h>

int main(void){
	int i, j;
	char c;

	while( (scanf_s("%d %d\n", &j, &i))==2){
		int **mine_arr = (int **)malloc(sizeof(int *) * i );
		int k, l;
		char c;

		for(k = 0; k < i; k++)
			mine_arr[k] = (int *)malloc(sizeof(int) * j);
			
		k = l = 0;
		while(scanf_s("%c", &c) == 1){
			mine_arr[k][l] = (c=='*') ? 1 : 0;
			if(l < j)
				l++;
			else{
				k++;
				l = 0;
			}
		}
		printf("%d\n", mine_arr[0][0]);
		
	}

	return(0);
}